#include "UdpServer.hpp"
#include <iostream>
#include <memory>

std::string Hello(const std::string &data)
{
    std::string hello("Hello, ");
    hello += data;
    return hello;
}

// ./udpserver port
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "Usage: " << argv[0] << " port" << std::endl;
        return 1;
    }
    uint16_t port = (uint16_t)std::stoi(argv[1]);
    std::unique_ptr<UdpServer> udpserver = std::make_unique<UdpServer>(port, Hello);

    udpserver->Start();

    return 0;
}